import {resolve} from 'path'
module.exports = {
  /*
  ** Headers of the page
  */
  head: {
    title: 'vue-nuxt',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: 'Nuxt.js project' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  /*
  ** Customize the progress bar color
  */
  plugins: [{
    src: '~plugins/ElementUI',
    ssr: true,
  },
  {
    src: '~plugins/axios',
    ssr: true
  }
],
  vendor:['element-ui'],
  css: [
    'element-ui/lib/theme-chalk/index.css',
    'assets/css/index.css'
  ],
  loading: { color: '#3B8070' },
  /*
  ** Build configuration
  */
  build: {
    /*
    ** Run ESLint on save
    */
    extend (config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  },
  modules: [
    '@nuxtjs/axios'
  ],
  // router: {
  //   middleware: ['axios','index']
  // },
  server: {
    port: 3000,
    host: '127.0.0.1'
  },
  link: [
    {}
  ],
  script: [
    {

    }
  ],
  env: {
    base: process.env.NODE_ENV === 'production'
  } // process.env.base app.env.base
}

